package net.chensee.avastxa.net;

import io.netty.channel.ChannelHandlerContext;
import io.netty.channel.ChannelInitializer;
import io.netty.channel.SimpleChannelInboundHandler;
import io.netty.channel.socket.SocketChannel;
import net.chensee.avastxa.common.socket.SocketClientStarter;

/**
 * input desc
 *
 * @author : xx
 * @Date : 2018/3/20
 * @Time : 17:02
 **/
public class NetClientMain {

    public static void main(String[] args) throws InterruptedException {
        NetStarter netStarter = new NetStarter();
        netStarter.start();

        SocketClientStarter.newInstance(2, "127.0.0.1", 8080).setInitialzer(new ChannelInitializer<SocketChannel>() {
            @Override
            protected void initChannel(SocketChannel sc) throws Exception {
                sc.pipeline()
                        .addLast(new SimpleChannelInboundHandler() {
                            @Override
                            public void channelActive(ChannelHandlerContext ctx) throws Exception {
                                super.channelActive(ctx);
                            }

                            @Override
                            protected void channelRead0(ChannelHandlerContext ctx, Object msg) throws Exception {
                            }
                        });
            }
        }).start();
    }

}
